package 圆桌座位;

import java.util.Scanner;

public class Main {
    static int N = 11, n, m;
    static int[] pos = new int[N];
    static boolean[] st = new boolean[N];
    static boolean[][] g = new boolean[N][N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        m = in.nextInt();
        for (int i = 0; i < m; i++) {
            int a = in.nextInt();
            int b = in.nextInt();
            g[a][b] = g[b][a] = true;
        }
        pos[0] = 1;
        st[1] = true;
        System.out.println(dfs(1));
    }

    private static int dfs(int u) {
        if (u == n) {
            if (g[pos[u - 1]][pos[0]]) {
                return 0;
            }
            return 1;
        }
        int ret = 0;
        for (int i = 2; i <= n; i++) {
            if (!st[i] && !g[pos[u - 1]][i]) {
                st[i] = true;
                pos[u] = i;
                ret += dfs(u + 1);
                st[i] = false;
            }
        }
        return ret;
    }
}
